package cn.com.wangluotongxin.merchants.service.impl.dubbo;

import cn.com.wangluotongxin.common.utils.TenantUtils;
import cn.com.wangluotongxin.merchants.DMerchantsMenuService;
import cn.com.wangluotongxin.merchants.service.IMerchantsMenuService;
import cn.com.wangluotongxin.merchants.vo.DMerchantsMenuVo;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class DMerchantsMenuServiceImpl implements DMerchantsMenuService {

    @Autowired
    private IMerchantsMenuService menuService;

    @Override
    public List<DMerchantsMenuVo> getList(String tenantId) {
        TenantUtils.set(tenantId, tenantId);
        List<DMerchantsMenuVo> menuVos = menuService.getList();
        TenantUtils.remove();
        return menuVos;
    }

    @Override
    public DMerchantsMenuVo detail(String tenantId, Integer id) {
        TenantUtils.set(tenantId, tenantId);
        DMerchantsMenuVo menuVo = menuService.detail(id);
        TenantUtils.remove();
        return menuVo;
    }
}
